﻿using System;
using System.Xml.Linq;

namespace FileZillaConfig.Helpers
{
    static class XMLItem
    {
        public static XElement Option(string name, string value)
        {
            string val = value;
            return new XElement("Option", val, new XAttribute("Name", name));
        }

        public static XElement Option(string name, int value)
        {
            string val = value.ToString();
            return new XElement("Option", val, new XAttribute("Name", name));
        }

        public static XElement Option(string name, Enum value)
        {
            string val = Convert.ToInt16(value).ToString();
            return new XElement("Option", val, new XAttribute("Name", name));
        }

        public static XElement Option(string name, bool value)
        {
            string val = Convert.ToInt16(value).ToString();
            return new XElement("Option", val, new XAttribute("Name", name));
        }
    }
}
